package tum0r.model;

import java.util.Comparator;
import java.util.LinkedList;

public class SecurityInformation implements Comparator<SecurityInformation> {
    private int ID;

    /**
     * 名称
     */
    public String Name;

    /**
     * 解释
     */
    public String Description;

    /**
     * 下属信息
     */
    public LinkedList<SecurityInformation> Children = new LinkedList<>();

    public void setID(int ID) {
        this.ID = ID;
    }

    public SecurityInformation() {
    }

    public SecurityInformation(String name, String description) {
        Name = name;
        Description = description;
    }

    public SecurityInformation(int ID, String name, String description) {
        this.ID = ID;
        Name = name;
        Description = description;
    }

    @Override
    public int compare(SecurityInformation o1, SecurityInformation o2) {
        return o1 != null && o2 != null ? Integer.compare(o1.ID, o2.ID) : 0;
    }
}
